package com.umeox.watch.moto.dataservice.db.dao;


import android.database.Cursor;

import androidx.annotation.NonNull;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.StepInfo;

import java.util.List;

@Dao
public interface StepInfoDao {

    @Query("SELECT * FROM step_info WHERE deviceId=:deviceId")
    StepInfo query(String deviceId);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    long save(@NonNull StepInfo stepInfo);

    @Delete
    int delete(StepInfo stepInfo);

    @Delete
    void delete(List<StepInfo> stepInfos);

    @Query("DELETE FROM step_info")
    int deleteAll();

    @Query("SELECT * FROM step_info")
    Cursor query();
}
